interface IPerson {
  name: string;
  age: number;
  height?: number;
}

// Omit<类型, 需要删除的属性>
// K extends keyof T: K必须是T的key
// P in keyof T as P extends K ? never : P 表示:遍历T的key，如果P是K，则跳过，否则返回P
type OmitType<T, K extends keyof T> = {
  [P in keyof T as P extends K ? never : P]: T[P]
}

type IPersonOmit = OmitType<IPerson, 'name' | 'height'>

const person: IPersonOmit = {
  age: 18
}

export {}
